<?php
/**
 * CreateTime: 2022/5/6 11:01
 */

namespace App\Tools\DingTalk;

use AlibabaCloud\SDK\Dingtalk\Vworkflow_1_0\Dingtalk;
use Darabonba\OpenApi\Models\Config;


trait NewDingTalkBasic
{
    /**
     * 新版钉钉 客户端
     * @return Dingtalk
     */
    private static function setNewDingTalkClient(): Dingtalk
    {
        $config = new Config([]);
        $config->protocol = "https";
        $config->regionId = "central";
        return new Dingtalk($config);
    }


    /**
     * 新版 获取钉钉客户端
     * @return \AlibabaCloud\SDK\Dingtalk\Voauth2_1_0\Dingtalk
     */
    protected static function getDingTalkNewClient(): Dingtalk
    {
        return self::setNewDingTalkClient();
    }
}